import React, {Component} from 'react'
import { Input, DatePicker, Button, Select, Form, Radio } from 'antd'

const Search =　Input.Search
const Option = Select.Option
const FormItem = Form.Item
const RadioGroup = Radio.Group


class FeedbackDetail extends Component {
  constructor() {
    super()
    this.state = {
      value: 1,
    }
    this.directorChange = this.directorChange.bind(this)
    this.onRadioChange = this.onRadioChange.bind(this)
  }

  directorChange(value) {
    console.log(`selected ${value}`);
  }

  onRadioChange(e) {
    console.log('radio checked', e.target.value);
    this.setState({
      value: e.target.value,
    })
  }

  render() {
    const children = []
    for (let i = 10; i < 36; i++) {
      children.push(<Option key={i.toString(36) + i}>{i.toString(36) + i}</Option>)
    }
    const { getFieldDecorator } = this.props.form
    return (
      <div className="rt-stu-new">
        <Form inline className="rt-form-course rt-form-new">
          <FormItem
            label="客户手机"
          >
            {getFieldDecorator('name')(
              <Input placeholder="请输入课程名称"/>
            )}
          </FormItem>
          <FormItem
            className="rt-feedback-content"
            label="反馈内容"
          >
          {getFieldDecorator('email')(
            <Input type="textarea" rows={5}/>
          )}
          </FormItem>
          <FormItem
            className="rt-radio-finance"
            label="反馈情绪"
          >
            <RadioGroup onChange={this.onRadioChange} value={this.state.value}>
              <Radio value={1}>正面</Radio>
              <Radio value={2}>普通</Radio>
              <Radio value={3}>负面</Radio>
            </RadioGroup>
          </FormItem>
        </Form>
        <Form inline className="rt-form-level rt-course-director">
          <FormItem
            label="负责人"
          >
            {getFieldDecorator('director')(
              <Select
                tags
                style={{ width: '100%' }}
                className="rt-select-tag"
                onChange={this.directorChange}
                tokenSeparators={[',']}
              >
                {children}
              </Select>
            )}
          </FormItem>
        </Form>
      </div>
     )
  }
}

export default Form.create()(FeedbackDetail)